Skip to content

Instantly share code, notes, and snippets.

@karpathy
karpathy / microgpt.py
Last active September 5, 2026 09:32
microgpt
"""
The most atomic way to train and run inference for a GPT in pure, dependency-free Python.
This file is the complete algorithm.
Everything else is just efficiency.
@karpathy
"""
import os # os.path.exists
import math # math.log, math.exp
@onevcat
onevcat / AGENTS.md
Created September 5, 2026 08:51
My agent memory file

基本设定

  • 服务对象为 onevcat:资深 iOS 开发者,技术力爆炸,所以不需要废话。重视 “Slow is Fast”、推理质量、抽象与长期可维护性。github.com/onevcat, onevcat.com, onev.cat, onev.dev, x.com/onevcat 等都视为用户相关
  • 代码、注释、标识符、提交信息及代码块内容用标准/简洁/明确的 English。技术文档优先使用 English;若文档现有中文语境,则正文中文、代码块 English。English 遵守 ASD-STE100 Simplified Technical English (STE)。
  • 对需要说明结论、方案或决策的任务,按“直接结论 → 简要推理 → 可选方案 → 可执行下一步”组织,不要长篇大论,不要事无巨细;简单确认、闲聊或一行答案直接回答。
  • 在修改文件时,使用待修改文件中使用的语言,切忌中英文混杂。
  • 处理 GitHub 相关操作优先使用 gh CLI。
  • 目标:作为强推理、强规划的编码助手,首要目标是完成任务。尽量一次到位,减少无谓澄清,只在明确被提问时才解释技术细节。

人设

LLM Wiki

A pattern for building personal knowledge bases using LLMs.

This is an idea file, it is designed to be copy pasted to your own LLM Agent (e.g. OpenAI Codex, Claude Code, OpenCode / Pi, or etc.). Its goal is to communicate the high level idea, but your agent will build out the specifics in collaboration with you.

The core idea

Most people's experience with LLMs and documents looks like RAG: you upload a collection of files, the LLM retrieves relevant chunks at query time, and generates an answer. This works, but the LLM is rediscovering knowledge from scratch on every question. There's no accumulation. Ask a subtle question that requires synthesizing five documents, and the LLM has to find and piece together the relevant fragments every time. Nothing is built up. NotebookLM, ChatGPT file uploads, and most RAG systems work this way.

@joshuafredrickson
joshuafredrickson / csp-mu-plugin.php
Last active September 5, 2026 09:25
Add CSP to WordPress, including nonces for inline scripts
<?php
/**
* Plugin Name: Content Security Policy
* Version: 1.0.1
* Description: Adds a Content-Security-Policy header to all non-admin requests.
* Requires PHP: 8.1
* Requires at least: 5.7.0
* License: GNU General Public License v2
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
* Original Inspiration: https://gist.github.com/westonruter/c8b49406391a8d86a5864fb41a523ae9
var amazon_assoc_ir_f_call_associates_ads = function(d) {
var b = "", c, a;
if (typeof JSON !== "undefined") {
a = JSON.stringify(d);
} else {
if (typeof amzn_assoc_utils !== "undefined") {
a = amzn_assoc_utils.stringify(d);
} else {
return;
}
@FlyTechVideos
FlyTechVideos / fontkiller.py
Created March 25, 2026 23:39
Script which modifies all fonts inside a given directory according to your desires. I can't think of any reasonable use cases for this.
#!/usr/bin/env python3
# The only requirement: fontTools (create venv, then pip install fontTools)
import os
from fontTools.ttLib import TTFont
from fontTools.pens.ttGlyphPen import TTGlyphPen
SOURCE_DIR = './fonts'
TARGET_DIR = './fonts_modified'

An guide how to activate Windows 11 Pro for free

Why?

Because you will get some more features like an Bitlocker and host your device as an External Desktop which can be accessed through the internet

Am i also able to switch from any other edition to Pro?

The answer is yes! You can switch from almost any edition to Pro completely for free!

Note for users with unactivated Pro edition

People which already have Pro, but not activated, can skip to this step.

Getting started

What you first need to do is open CMD (Command Prompt) as Administrator using this keyboard key:

竟0

淨零碳規劃管理師-初級能力鑑定 題庫整理

更新日期 2026/07/13

說明

本文彙整了「淨零碳規劃管理師-初級能力鑑定」113-115 年度的 782 題考古題,內容僅供參考,考試命題不一定會相同,請考生留意。

  • 使用方法:Ctrl + F 直接輸入題目關鍵字搜尋即可
@primaryobjects
primaryobjects / hotspot-keep-alive.ps1
Last active September 5, 2026 09:05
Script to Enable Windows 10 Mobile Hotspot Automatically After Reboot
# https://superuser.com/a/1434648
Add-Type -AssemblyName System.Runtime.WindowsRuntime
$asTaskGeneric = ([System.WindowsRuntimeSystemExtensions].GetMethods() | ? { $_.Name -eq 'AsTask' -and $_.GetParameters().Count -eq 1 -and $_.GetParameters()[0].ParameterType.Name -eq 'IAsyncOperation`1' })[0]
Function Await($WinRtTask, $ResultType) {
$asTask = $asTaskGeneric.MakeGenericMethod($ResultType)
$netTask = $asTask.Invoke($null, @($WinRtTask))
$netTask.Wait(-1) | Out-Null
$netTask.Result